package com.itcoon.cloud.framework.security.config.properties;


import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Collections;
import java.util.List;

@ConfigurationProperties(prefix = "itcoon.web.security")
public class AuthEntrypointManageProperties {

    private String i18nBundlePath = "i18n/security";

    private List<Path> paths = Collections.emptyList();

    public List<Path> getPaths() {
        return paths;
    }

    public void setPaths(List<Path> paths) {
        this.paths = paths;
    }

    public String getI18nBundlePath() {
        return i18nBundlePath;
    }

    public void setI18nBundlePath(String i18nBundlePath) {
        this.i18nBundlePath = i18nBundlePath;
    }

    public static class Path{

        private String basic;

        private List<String> permitAll = Collections.emptyList();

        private List<String> anonymous = Collections.emptyList();

        private Boolean enableCaptcha = Boolean.FALSE;

        private String login;

        private String logout;

        private Boolean cors = true;

        public Path(String basic, List<String> permitAll, List<String> anonymous, Boolean enableCaptcha, String login, String logout, Boolean cors) {
            this.basic = basic;
            this.permitAll = permitAll;
            this.anonymous = anonymous;
            this.enableCaptcha = enableCaptcha;
            this.login = login;
            this.logout = logout;
            this.cors = cors;
        }

        public Path() {
        }

        public String getBasic() {
            return basic;
        }

        public void setBasic(String basic) {
            this.basic = basic;
        }

        public List<String> getPermitAll() {
            return permitAll;
        }

        public void setPermitAll(List<String> permitAll) {
            this.permitAll = permitAll;
        }

        public List<String> getAnonymous() {
            return anonymous;
        }

        public void setAnonymous(List<String> anonymous) {
            this.anonymous = anonymous;
        }

        public String getLogin() {
            return login;
        }

        public void setLogin(String login) {
            this.login = login;
        }

        public String getLogout() {
            return logout;
        }

        public void setLogout(String logout) {
            this.logout = logout;
        }

        public Boolean getCors() {
            return cors;
        }

        public void setCors(Boolean cors) {
            this.cors = cors;
        }

        public Boolean getEnableCaptcha() {
            return enableCaptcha;
        }

        public void setEnableCaptcha(Boolean enableCaptcha) {
            this.enableCaptcha = enableCaptcha;
        }

    }
}
